<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue组件-4 v-model语法糖</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <p>message: {{message}}</p>
        <!--
            v-model: 双向绑定
            模型=====>视图: v-bind
            模型<=====视图: @input 
        -->
        <input type="text" :value="message" @input="changeValue" >
    </div>
    <script>
        new Vue({
            el:'#app',
            data:{
                message:'我是独狼,你好骚硕'
            },
            methods:{
                changeValue: function (event){
                    // 把输入框的值赋值给message
                    console.log(event.target.value,'**');
                    // this.message=event.target.value
                }
            },

            
        })
    </script>
</body>
</html>